<template>
    <van-popup  position="bottom" :overlay="true" v-model="showArea">
            <van-datetime-picker
          v-model="currentDate"
          type="date"
          :min-date="minDate"
          @confirm="onConfirm"
          @cancel="onCancel"
        />
    </van-popup>
</template>
<script>
    export default{
        name:'minePopupTimePicker',
        methods:{
            onCancel(){//取消时隐藏
            this.showArea=false
        },
            onConfirm(val){//确认时隐藏并且返回当前models给resume，用于双向绑定数据用
                this.showArea=false;
                let year=val.getFullYear()
                let month=val.getMonth()+1;
                let day=val.getDate();
                let date=`${year}-${month}-${day}`;
                this.$emit('getSelectValue',val,date)
            },
            onChange(picker, values) {//用于改变当前要显示的此选项
                picker.setColumnValues(1, this.col[values[0]]);
                }
        },
        data(){
            return{
                showArea:false,
                minDate:new Date(1970, 0, 1),
                currentDate:''
            }
        }
    }
</script>
<style scoped>

</style>
<style >
    .van-modal{
        width:100vw;
        height: 100vh;
    }
</style>
